home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Libraries / SAT 2.3a1 / SATminimal ƒ / SATminimal.p < prev    next >
Encoding:
Text File  |  1994-10-19  |  1.3 KB  |  51 lines  |  [TEXT/PJMM]

  1. {Minimal demo program, with a few sprites moving back and forth.}
  2.  
  3. program SATminimal;
  4.  
  5.     uses
  6. {$ifc UNDEFINED THINK_PASCAL}
  7.         Types, QuickDraw, Menus, Windows, TextEdit, Fonts,
  8.         Dialogs, Memory, {}
  9. {$endc}
  10.         SAT, sMySprite;
  11.     var
  12.         ignoreSp: SpritePtr;
  13.         l: longint;
  14. begin
  15. {Standard Inits are done by Think Pascal.}
  16. {$ifc UNDEFINED THINK_PASCAL}
  17.     { Initialize all the needed managers. }
  18.     InitGraf(@qd.thePort);
  19.     InitFonts;
  20.     InitWindows;
  21.     InitMenus;
  22.     TEInit;
  23.     InitDialogs(NIL);
  24.     InitCursor;
  25.     MaxApplZone;
  26. {$endc}
  27.  
  28. {Initialize, using PICTs 128 or 129 as background, Classic-sized drawing area}
  29.     SATInit(128, 129, 512, 322);
  30.  
  31. {Initialize sprite unit(s), by preloading faces and sounds}
  32.     InitMySprite;
  33.  
  34. {Make some sprites}
  35.     ignoreSp := SATNewSprite(0, 50, 50, @SetupMySprite);
  36.     ignoreSp := SATNewSprite(0, 100, 100, @SetupMySprite);
  37.     ignoreSp := SATNewSprite(0, 125, 120, @SetupMySprite);
  38.     ignoreSp := SATNewSprite(0, 150, 140, @SetupMySprite);
  39.     ignoreSp := SATNewSprite(0, 200, 180, @SetupMySprite);
  40.     ignoreSp := SATNewSprite(0, 250, 200, @SetupMySprite);
  41.     ignoreSp := SATNewSprite(0, 300, 250, @SetupMySprite);
  42.  
  43.     repeat
  44.         l := TickCount;
  45.         SATRun(true); {Run one frame of animation}
  46.         while l > TickCount - 3 do {Maximize speed to 20 fps}
  47.             ;
  48.     until Button;
  49.  
  50.     SATSoundShutUp; {Always de-allocate the sound channel before quitting!}
  51. end.